package com.aqie.seller;

import com.hazelcast.core.HazelcastInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Map;

// 多个节点内存当一个使用 ： 分布式
@Component
public class HazelcastMapTest {

    @Autowired
    private HazelcastInstance hazelcastInstance;

    @PostConstruct          // 初始化就执行
    public void put(){
        Map map = hazelcastInstance.getMap("aqie");
        map.put("name","aqie");
    }
}
